﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ylh.Model;
using System.Data;

namespace Ylh.IDAL
{
   public  interface IRole
    {
        /// <summary>
        /// 执行插入角色,返回插入后的的角色ID
        /// </summary>
        /// <param name="ConStr">指定的数据库</param>
        /// <param name="RoleName">角色名称</param>
        /// <param name="Remark">角色备注</param>
        /// <param name="Remark">创建人</param>
        /// <returns>角色ID</returns>
       int InsertRole(string ConStr, string RoleName, string Remark, string Creater, string ProtectCount);
       


        /// <summary>
        /// 更新角色信息
        /// </summary>
        /// <param name="ConStr">指定的数据库</param>
        /// <param name="RoleName">角色名称</param>
        /// <param name="Remark">角色备注</param>
        /// <param name="RoleID">角色编号</param>
        /// <returns>是否更新成功</returns>
       bool UpdateRole(String ConStr, string RoleName, string Remark, decimal RoleID, string ProtectCount);
       


        /// <summary>
        /// 判断该名称是否存在
        /// </summary>
        /// <param name="ConStr">指定的数据库</param>
        /// <param name="RoleName">角色名称</param>
        /// <returns></returns>
        bool IsExistsRole(string ConStr, string RoleName);
        


        /// <summary>
        /// 获取对应的角色信息
        /// 如果RoleID等于-1是获取所有信息
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="RoleID"></param>
        /// <returns></returns>
        DataTable GetRoleInFo(string ConStr, decimal RoleID);



        /// <summary>
        /// 根据编号删除角色
        /// 顺便删除编号下面已经有的权限
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="RoleID">角色编号</param>
        /// <returns></returns>
        bool DeleteRoleByRoleID(string ConStr, string RoleID);


        /// <summary>
        /// 判断角色是否已经有员工使用了
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="RoleID">角色编号</param>
        /// <returns></returns>
        bool IsUseByStaff(String ConStr, string RoleID);


        int GetProtectCount(string ConStr, string RoleID);
    }
}
